
#ifndef _COMMON_H_
#define _COMMON_H_

/*
 * Include the generic CPU header file
 */
   


/*
 * Include the cpu specific header file
 */



	
#if defined(__ICCARM__)
#define     __RAMFUN   __ramfunc
#else
#define     __RAMFUN
#endif
	
	//类型别名宏定义
	typedef unsigned char	    uint8;  // 8 bits
	typedef unsigned short int	    uint16; // 16 bits
	typedef unsigned long int	    uint32; // 32 bits
	
	typedef char			     int8;   //  8 bits 
	typedef short int	       	     int16;  // 16 bits
	typedef int		       	     int32;  // 32 bits
	
	typedef volatile int8		     vint8;  //  8 bits
	typedef volatile int16	     vint16; // 16 bits
	typedef volatile int32	     vint32; // 32 bits
	
	typedef volatile uint8	     vuint8;  //  8 bits
	typedef volatile uint16	     vuint16; // 16 bits
	typedef volatile uint32            vuint32; // 32 bits
        typedef volatile float            vfloat ; // 
        typedef void(func)(void)            ;
				
				
#pragma anon_unions			
//bit类型定义
typedef union
{
    uint32  DU;
    uint16  W[2];
    uint8   B[4];
    struct
    {
        uint32 b0: 1;
        uint32 b1: 1;
        uint32 b2: 1;
        uint32 b3: 1;
        uint32 b4: 1;
        uint32 b5: 1;
        uint32 b6: 1;
        uint32 b7: 1;
        uint32 b8: 1;
        uint32 b9: 1;
        uint32 b10: 1;
        uint32 b11: 1;
        uint32 b12: 1;
        uint32 b13: 1;
        uint32 b14: 1;
        uint32 b15: 1;
        uint32 b16: 1;
        uint32 b17: 1;
        uint32 b18: 1;
        uint32 b19: 1;
        uint32 b20: 1;
        uint32 b21: 1;
        uint32 b22: 1;
        uint32 b23: 1;
        uint32 b24: 1;
        uint32 b25: 1;
        uint32 b26: 1;
        uint32 b27: 1;
        uint32 b28: 1;
        uint32 b29: 1;
        uint32 b30: 1;
        uint32 b31: 1;
    };
} Bittyp; 

//#define __NVIC_PRIO_BITS          (4)
#define  INC_IRQ                (-16)

    /* Register definitions */
//#include "fsl_device_registers.h"
#include "system_S32K146.h"
#include "core_cm4.h"

//#include "fsl_core_cm4.h"




extern uint32_t SystemCoreClock ;   //系统时钟
extern uint32_t BUSClock ;          //总线时间
extern uint32_t FALSHClock ;        //flash时间


/*!< Macro to enable all interrupts. */
#define EnableInterrupts asm(" CPSIE i");

/*!< Macro to disable all interrupts. */
#define DisableInterrupts asm(" CPSID i");


#endif 
